import 'package:flutter/material.dart';
import 'package:untitled1/app/res/myColors.dart';

//支付提示框
void showLockInfoDialog(BuildContext context) {
  showDialog(
    context: context,
    barrierDismissible: false, // 点击外部不关闭
    builder: (context) {
      return Dialog(
        backgroundColor: Colors.white, // 明确背景为白
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
        insetPadding: const EdgeInsets.symmetric(horizontal: 40),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            // 标题
            Padding(
              padding: const EdgeInsets.only(top: 20),
              child: Text(
                "确定锁定信息吗？",
                style: const TextStyle(
                  fontSize: 14,
                  fontWeight: FontWeight.bold,
                  color: Colors.black,
                ),
              ),
            ),
            const SizedBox(height: 16),

            // 内容部分
            Padding(
              padding: const EdgeInsets.symmetric(horizontal: 20),
              child: Column(
                children: [
                  // 第一行，部分红色高亮
                  RichText(
                    textAlign: TextAlign.center,
                    text: TextSpan(
                      text: '请支付',
                      style: const TextStyle(color: Colors.black87, fontSize: 14),
                      children: [
                        const TextSpan(
                          text: '9',
                          style: TextStyle(
                            color: Colors.red,
                            fontWeight: FontWeight.bold,
                            fontSize: 30,
                          ),
                        ),
                        const TextSpan(
                          text: '元',
                          style: TextStyle(color: Colors.black87, fontSize: 14),
                        ),
                      ],
                    ),
                  ),
                  const SizedBox(height: 10),

                  // 第二行红色警告文字
                  const Text(
                    '锁定后，请在15分钟内电话沟通未及时沟通的系统自动取消锁定',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      color: Colors.red,
                      fontSize: 13,
                    ),
                  ),
                  const SizedBox(height: 6),

                  // 第三行灰色提示
                  const Text(
                    '（23点-次日8点，不计时）',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      color: Colors.grey,
                      fontSize: 12,
                    ),
                  ),
                ],
              ),
            ),

            const SizedBox(height: 20),
            const Divider(height: 1),

            // 按钮区
            SizedBox(
              height: 48,
              child: Row(
                children: [
                  Expanded(
                    child: GestureDetector(
                      onTap: () => Navigator.pop(context),
                      child: const Center(
                        child: Text(
                          "取消",
                          style: TextStyle(
                            color: Colors.black87,
                            fontSize: 14,
                          ),
                        ),
                      ),
                    ),
                  ),
                  // 竖线分割

                  Container(width: 1,
                      height: 50,
                      color: myColors.c_D1D3D5),
                  Expanded(
                    child: GestureDetector(
                      onTap: () {
                        Navigator.pop(context);
                        // 这里可以加入你的逻辑，比如发起支付
                      },
                      child: const Center(
                        child: Text(
                          "确定",
                          style: TextStyle(
                            color: Colors.red,
                            fontWeight: FontWeight.bold,
                            fontSize: 14,
                          ),
                        ),
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      );
    },
  );
}
